Question: Each of the nine dots in this figure is to be colored red, white or blue. No two dots connected by a segment (with no other dots between) may be the same color. How many ways are there to color the dots of this figure?

[asy]
draw((-75,0)--(-45,0)--(-60,26)--cycle);
draw((0,0)--(30,0)--(15,26)--cycle);
draw((75,0)--(105,0)--(90,26)--cycle);
draw((-60,26)--(90,26));
draw((-45,0)--(75,0));
dot((-75,0));
dot((-45,0));
dot((-60,26));
dot((15,26));
dot((0,0));
dot((30,0));
dot((90,26));
dot((75,0));
dot((105,0));
[/asy]
Answer: There are six ways to color the equilateral triangle on the left.  Without loss of generality, assume it is colored as below.

[asy]
draw((-75,0)--(-45,0)--(-60,26)--cycle);
draw((0,0)--(30,0)--(15,26)--cycle);
draw((75,0)--(105,0)--(90,26)--cycle);
draw((-60,26)--(90,26));
draw((-45,0)--(75,0));

dot("B", (-75,0), S);
dot("W", (-45,0), S);
dot("R", (-60,26), N);
dot((15,26));
dot((0,0));
dot((30,0));
dot((90,26));
dot((75,0));
dot((105,0));
[/asy]

Then there are three ways to color the middle equilateral triangle:

[asy]
int i;
pair transy = (0,-70);

for (i = 0; i <= 2; ++i) {
  draw(shift(i*transy)*((-75,0)--(-45,0)--(-60,26)--cycle));
  draw(shift(i*transy)*((0,0)--(30,0)--(15,26)--cycle));
  draw(shift(i*transy)*((75,0)--(105,0)--(90,26)--cycle));
  draw(shift(i*transy)*((-60,26)--(90,26)));
  draw(shift(i*transy)*((-45,0)--(75,0)));

  dot("B", (-75,0) + i*transy, S);
  dot("W", (-45,0) + i*transy, S);
  dot("R", (-60,26) + i*transy, N);
  dot((15,26) + i*transy);
  dot((0,0) + i*transy);
  dot((30,0) + i*transy);
  dot((90,26) + i*transy);
  dot((75,0) + i*transy);
  dot((105,0) + i*transy);
}

dot("B", (15,26), N);
dot("R", (0,0), S);
dot("W", (30,0), S);

dot("W", (15,26) + (0,-70), N);
dot("R", (0,0) + (0,-70), S);
dot("B", (30,0) + (0,-70), S);

dot("W", (15,26) + (0,-2*70), N);
dot("B", (0,0) + (0,-2*70), S);
dot("R", (30,0) + (0,-2*70), S);
[/asy]

Now we want to color the third equilateral triangle.  For each case above, we are exactly in the same position as before, as when the first equilateral triangle was colored, and we wanted to color the second equilateral triangle.  This means that in each case, there are three ways to color the third equilateral triangle.

Therefore, the total number of possible colorings is $6 \cdot 3 \cdot 3 = \boxed{54}$.